<?php
namespace Models;

class ImageArray
{
	private $_images = array();
	
	public function __construct(){}
	
	/**
	 * Lägger till en användare i användar-arrayen
	 */
	public function add(Image $image)
	{
		$this->_images[] = $image; 
	}
	
	/**
	 * Hämtar array av användare
	 * @return Array (User)
	 */
	public function get()
	{
		return $this->_images;
	}
}

class Image
{
	private $_imageId; //Int
	private $_albumId; //Int
	private $_imageUrl; //String
	private $_thumbUrl; //Int
	private $_description; //String
	
	public $isValid = true;
	
	/**
	 * Instansiera objekt
	 * @param $imageId int
	 * @param $albumId int
	 * @param $description string
	 * @param $imgUrl string
	 * @param $thumbUrl string
	 */
	public function __construct($imageId, $albumId, $description, $imgUrl, $thumbUrl)
	{
		$this->_imageId = $imageId;
		$this->_albumId = $albumId;
		$this->_imageUrl = $imgUrl;
		$this->_thumbUrl = $thumbUrl;
		$this->_description = $description;
		
		if(!is_numeric($imageId) || !is_numeric($albumId))
			$this->isValid = false;
		
		if($thumbUrl = "" || $imgUrl = "")
			$this->isValid = false;
	}
	
	public function ImageId()
	{
		return $this->_imageId;
	}
	
	public function AlbumId()
	{
		return $this->_albumId;
	}
	
	public function Description()
	{
		return $this->_description;
	}
	
	public function ImageUrl()
	{
		return $this->_imageUrl;
	}
	
	public function ThumbUrl()
	{
		return $this->_thumbUrl;
	}
}

?>